#!/usr/bin/node

const cp = require('child_process');

let child = cp.spawn('./03-child.js',[],{detach:true,stdio:['ignore', 1, 2]});

//child.stdout.pipe(process.stdout);
child.unref();//释放子进程指针，将子进程的流重定向到操作系统的流



console.log('I am father Process:',process.pid);
setTimeout(()=>{
  console.log('Goodbye!');
  process.exit();
},5000);
// 父进程结束后，子进程也结束

